import request from '@/utils/request'
import { makeFormData } from '@/utils/util'
export function getPlanList (params = {}) {
  return request({
    url: 'crm/fin/plan/list',
    method: 'get',
    params
  })
}

export function addPlan (params = {}, method = 'post') {
  return request({
    url: 'crm/fin/plan',
    method: method,
    params
  })
}
export function cancelPlan (params = {}, method = 'post') {
  return request({
    url: 'crm/fin/plan/cancel',
    method: method,
    params
  })
}

export function getOrder (params = {}) {
  return request({
    url: 'crm/fin/order',
    method: 'get',
    params
  })
}

export function getOrderList (params = {}) {
  return request({
    url: 'crm/fin/order/list',
    method: 'get',
    params
  })
}

export function cancelOrder (params = {}, method = 'post') {
  return request({
    url: 'crm/fin/order/cancel',
    method: method,
    params
  })
}

export function notifyOrder (params = {}) {
  return request({
    url: 'crm/fin/order/notify_parent',
    method: 'post',
    params
  })
}

export function notifyPlan (params = {}) {
  return request({
    url: 'crm/fin/plan/notify_parents',
    method: 'post',
    params
  })
}

export function getProductSolution (params = {}) {
  return request({
    url: 'crm/fin/product_solution/list',
    method: 'get',
    params
  })
}

export function getFindorder (params = {}) {
  return request({
    url: 'crm/fin/order',
    method: 'get',
    params
  })
}

export function getProductPage (params = {}) {
  return request({
    url: 'crm/web/product/page',
    method: 'get',
    params
  })
}

export function addAll (params = {}, method = 'post') {
  return request({
    url: 'crm/fin/order/add_all',
    method: method,
    data: makeFormData(params)
  })
}

export function getClasses (params = {}) {
  return request({
    url: 'crm/v2/cc/classes',
    method: 'get',
    params
  })
}

export function getProductSolutionDetail (params = {}) {
  return request({
    url: 'crm/fin/product_solution',
    method: 'get',
    params
  })
}
